#!/usr/bin/env python
# -*- coding: utf-8 -*-

'''eof
name:对外投资指数
code:RPOutInvestmentIndex
tableName:
columnName:
groups:关联方
dependencies:EG_BBD
type:常用指标
dataSourceType:在线指标
description:
eof'''

import sys

reload(sys)
sys.setdefaultencoding('utf-8')


def int_check(num):
    try:
        int(num)
        return True
    except:
        return False


def RPOutInvestmentIndex():
    try:
        interface_data = EG_BBD["srcData"][0]["OFF_RELATED_INDEX"]
        if interface_data["status"] != 200:
            return u'缺失值'
        fac = str(interface_data["data"][0]["indexCodes"]["35B"])
        if int_check(fac) and int(fac) != 99999:
            return fac
        else:
            return u'缺失值'
    except:
        return u'缺失值'


result = RPOutInvestmentIndex()

